#!/bin/sh
#LIBS="-lkrb5 -lk5crypto -lpgport -lgssapi_krb5 -lkrb5support -lgssapi_krb5 -lcom_err -lnsl -lresolv" \
CC="ccache gcc" CXX="ccache g++" CPPFLAGS=-I/usr/local/include/botan-1.10 ./configure \
		--with-modules="bind gmysql gpgsql gsqlite3 pipe geo lua random" \
	--with-dynmodules="" \
	--enable-static-binaries \
	--with-pgsql-lib=/opt/postgresql/lib --with-pgsql-includes=/opt/postgresql/include \
	--prefix=/usr \
	--sysconfdir=/etc/powerdns --enable-botan1.10 --enable-cryptopp \
	--mandir=/usr/man/ \
&& make clean && make -j4 && \
fakeroot /bin/sh -c "rm -rf /tmp/pdns ; DESTDIR=/tmp/pdns make install-strip" &&
fakeroot rm -f /tmp/pdns/usr/lib/pdns/*.a /tmp/pdns/usr/lib/pdns/*.la &&
fakeroot install -d -m 755 -o root -g root /tmp/pdns/etc/init.d &&
fakeroot install -p -m 755 -o root -g root pdns/pdns.init /tmp/pdns/etc/init.d/pdns &&
fakeroot mkdir -p /tmp/pdns/etc/powerdns &&
fakeroot mv /tmp/pdns/etc/powerdns/pdns.conf-dist /tmp/pdns/etc/powerdns/pdns.conf &&
fakeroot rm /tmp/pdns/usr/bin/zone2ldap &&
fakeroot rpmbuild -bb pdns.spec --buildroot /tmp/pdns

